package cn.zzf.algs.note.base.struct;

/**
 * 链表结点对象
 *
 * @author GaoFeng2017
 * @date 2020/6/11 10:50
 */
public class Node<T> {

    /** 结点值 */
    private T value;

    /** 上一个结点 */
    private Node<T> prev;

    /** 下一个结点 */
    private Node<T> next;

    public Node() {
    }

    public Node(Node<T> prev, T value) {
        this.prev = prev;
        this.value = value;
    }

    public Node(T value, Node<T> next) {
        this.next = next;
        this.value = value;
    }

    public Node(T value, Node<T> prev, Node<T> next) {
        this.value = value;
        this.prev = prev;
        this.next = next;
    }

    public Node(T value) {
        this.value = value;
    }

    public T getValue() {
        return value;
    }

    public void setValue(T value) {
        this.value = value;
    }

    public Node<T> getPrev() {
        return prev;
    }

    public void setPrev(Node<T> prev) {
        this.prev = prev;
    }

    public Node<T> getNext() {
        return next;
    }

    public void setNext(Node<T> next) {
        this.next = next;
    }

    @Override
    public String toString() {
        return "Node{" +
                "value=" + value +
                ", prev=" + prev +
                ", next=" + next +
                '}';
    }




}
